Function: namevalue2varargin

CALL:

DESCRIPTION:

Convert array of name value pairs to varargin cell array

INPUT:

nv struct[]
with fields: +----name
             +----value

OUTPUT:

args cell
content of nv rearranged as:
{nv(1).name, nv(1).value, nv(2).name, nv(2).value, ..}

EXAMPLE:

      nv=json2struct( .... ) (specify json input string here)
      args=namevalue2varargin(nv);
      defopt= ... (specify defaults here)
      inputopt=varargin2struct(defopt,fieldnames(defopt),args{:})
  
    Copyright 2006-2015 Modelit, www.modelit.nl